import type { IModelConfig } from '@/components/page-model/type'

const modelConfig: IModelConfig = {
  title: {
    addNewTitle: '新增菜单',
    editTitle: '编辑菜单'
  },
  formItems: [
    {
      type: 'input',
      prop: 'name',
      label: '名称',
      placeholder: '请输入名称',
    },
    {
      type: 'select',
      prop: 'menuType',
      label: '类型',
      related:'pid',
      placeholder: '请选择类型',
      options: [{label:'模块',value:1},{label:'菜单',value:2},{label:'操作',value:3}]
    },
    {
      type: 'menu',
      prop: 'pid',
      label: '上级',
      placeholder: '请选择上级',
      options: [],
    },
    {
      type: 'select',
      prop: 'hide',
      label: '是否隐藏菜单',
      placeholder: '请选择是否隐藏菜单',
      options: [{label:'显示',value:0},{label:'隐藏',value:1}],
      hide:true
    },
    {
      type: 'input',
      prop: 'url',
      label: '后台路由地址',
      placeholder: '请输入后台路由地址'
    },
    {
      type: 'input',
      prop: 'sort',
      label: '序号',
      placeholder: '请输入序号'
    },
  ],
  rules: {
    name: [{ required: true, message: '必须输入名称', trigger: 'blur' }],
    menuType: [{ required: true, message: '必须选择类型', trigger: 'change' }],
    url: [{ required: true, message: '必须输入后台路由地址', trigger: 'blur' }],
  }
}

export default modelConfig
